package org.platform.controller.knowledge;

import com.mc.mic.core.bo.CmdBO;
import com.mc.mic.core.bus.provider.BaseServiceRegister;
import org.platform.mo.csmo.cmd10017.TreeSetRequestParam;
import org.platform.mo.csmo.cmd10017.TreeSetResponseParam;
import org.platform.mo.csmo.cmd10018.TreeQueryRequestParam;
import org.platform.mo.csmo.cmd10018.TreeQueryResponseParam;
import org.platform.mo.csmo.cmd10019.TreeAddRequestParam;
import org.platform.mo.csmo.cmd10019.TreeAddResponseParam;
import org.platform.mo.csmo.cmd10020.TreeDelRequestParam;
import org.platform.mo.csmo.cmd10020.TreeDelResponseParam;
import org.platform.mo.csmo.cmd10021.TreeModifyRequestParam;
import org.platform.mo.csmo.cmd10021.TreeModifyResponseParam;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author FengJie
 * @date 2018/4/16
 */
@RestController
public class TreeRegister extends BaseServiceRegister {
    /**
     * 查询当前所有的故障树集合（10017）
     *
     * @param cmdBO
     * @return
     */
    @PostMapping(value = "10017")
    public CmdBO queryTreeSet(@RequestBody CmdBO<TreeSetRequestParam, TreeSetResponseParam> cmdBO) {
        return super.serviceExecutor(cmdBO);
    }

    /**
     * 查询正在使用的故障树（10018）
     *
     * @param cmdBO
     * @return
     */
    @PostMapping(value = "10018")
    public CmdBO queryTree(@RequestBody CmdBO<TreeQueryRequestParam, TreeQueryResponseParam> cmdBO) {
        return super.serviceExecutor(cmdBO);
    }

    /**
     * 增加故障树（10019）
     *
     * @param cmdBO
     * @return
     */
    @PostMapping(value = "10019")
    public CmdBO addTree(@RequestBody CmdBO<TreeAddRequestParam, TreeAddResponseParam> cmdBO) {
        return super.serviceExecutor(cmdBO);
    }

    /**
     * 删除故障树（10020）
     *
     * @param cmdBO
     * @return
     */
    @PostMapping(value = "10020")
    public CmdBO delTree(@RequestBody CmdBO<TreeDelRequestParam, TreeDelResponseParam> cmdBO) {
        return super.serviceExecutor(cmdBO);
    }

    /**
     * 修改故障树（10021）
     *
     * @param cmdBO
     * @return
     */
    @PostMapping(value = "10021")
    public CmdBO modifyTree(@RequestBody CmdBO<TreeModifyRequestParam, TreeModifyResponseParam> cmdBO) {
        return super.serviceExecutor(cmdBO);
    }
}
